package org.sixtynine.stock.service.impl;

import org.sixtynine.stock.dao.PaymentConfigDao;
import org.sixtynine.stock.entity.PaymentConfig;
import org.sixtynine.stock.service.PaymentConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author Thilan
 * 
 */

@Service
public class PaymentConfigServiceImpl implements PaymentConfigService {

	@Autowired
	private PaymentConfigDao paymentConfigDao;

	@Override
	public PaymentConfig findById(int id) {
		return paymentConfigDao.findById(id);
	}

	@Override
	@Transactional(readOnly = false)
	public void savePaymentConfign(PaymentConfig paymentConfig) {
		paymentConfigDao.savePaymentConfig(paymentConfig);
	}

	@Override
	@Transactional(readOnly = false)
	public void deletePaymentConfig(int id) {
		PaymentConfig paymentConfig = paymentConfigDao.findById(id);
		if (paymentConfig != null) {
			paymentConfigDao.delete(paymentConfig);
		}
	}

}
